package com.baor.controller;

import com.baor.domain.FinanceVo;
import com.baor.service.FinanceService;
import com.baor.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/finance")
public class FinanceController {

    @Autowired
    private FinanceService financeService;

    @RequestMapping("/financialStatementList")
    public AjaxResult<?> financialStatementList(@RequestBody Map<String, Object> params) {
        return financeService.financialStatementList(params);
    }

    @RequestMapping("/getFinanceById")
    public AjaxResult<?> getFinanceById(Integer financeId) {
        return financeService.getFinanceById(financeId);
    }

    @RequestMapping("/withdrawalList")
    public AjaxResult<?> withdrawalList(@RequestBody Map<String, Object> params) {
        return financeService.withdrawalList(params);
    }

    @RequestMapping("/backList")
    public AjaxResult<?> backList(@RequestBody Map<String,Object> map){
        return financeService.backList(map);
    }

    @RequestMapping("/backInfo/{id}")
    public AjaxResult<?> backInfo(@PathVariable Integer id){
        return financeService.backInfo(id);
    }
    @RequestMapping("/update")
    public AjaxResult<?> udpate(@RequestBody FinanceVo financeVo){
        return financeService.update(financeVo);
    }

    @RequestMapping("/update2")
    public AjaxResult<?> udpate2(@RequestBody FinanceVo financeVo){
        return financeService.update2(financeVo);
    }

    @RequestMapping("/payList")
    public AjaxResult<?> payList(@RequestBody Map<String,Object> map){
        return financeService.payList(map);
    }

    @RequestMapping("/backList2")
    public AjaxResult<?> backList2(@RequestBody Map<String,Object> map){
        return financeService.backList2(map);
    }

}
